package cn.poem.controller;


import cn.poem.base.ResponseData;
import cn.poem.entity.*;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.web.bind.annotation.*;

/**
 * @Description 收藏
 * @Author sugar
 * @Date 2021/5/14 4:11 PM
 * @Version 1.0
 */
@RequestMapping("poem/favorites/")
public interface FavoritesController {

    /**
     * 2。收藏夹列表分页 诗词人
     * @param page
     * @param size
     * @param favoritesAuthor
     * @return
     */
    @GetMapping("author/page/{page}/{size}")
    ResponseData<IPage<AuthorBase>> favoritesAuthor(@PathVariable("page") int page, @PathVariable("size") int size, FavoritesAuthor favoritesAuthor);

    /**
     * 收藏夹列表 诗词
     * @param page
     * @param size
     * @param favoritesPoetry
     * @return
     */
    @GetMapping("poetry/page/{page}/{size}")
    ResponseData<IPage<PoetryBase>> favoritesPoetry(@PathVariable("page") int page, @PathVariable("size") int size, FavoritesPoetry favoritesPoetry);

    /**
     * 收藏夹列表Comments
     * @param page
     * @param size
     * @param favoritesComments
     * @return
     */
    @GetMapping("comments/page/{page}/{size}")
    ResponseData<IPage<PoetryComments>> favoritesComments(@PathVariable("page") int page, @PathVariable("size") int size, FavoritesComments favoritesComments);

    /**
     * 收藏诗词人
     * @param favoritesAuthor
     * @return
     */
    @PostMapping("author")
    ResponseData<Boolean> author(@RequestBody FavoritesAuthor favoritesAuthor);

    /**
     * 收藏诗词
     * @param favoritesPoetry
     * @return
     */
    @PostMapping("poetry")
    ResponseData<Boolean> poetry(@RequestBody FavoritesPoetry favoritesPoetry);

    /**
     * 收藏读后感
     * @param favoritesComments
     * @return
     */
    @PostMapping("comments")
    ResponseData<Boolean> comments(@RequestBody FavoritesComments favoritesComments);

    @PostMapping("add/{code}/{objectId}")
    ResponseData<Boolean> add(@PathVariable("code") int code, @PathVariable("objectId") Long objectId);


    @PostMapping("cancel/{code}")
    ResponseData<Boolean> cancel(@PathVariable("code") int code);





}
